{include file="Public:header2"/}
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <form method="get" action="{:url('/admin/withdraw')}" class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline" style="display:none">
                    <div class="layui-input-block">
                        <input type="text" name="keyword" value="{$Request.get.keyword}" placeholder="请输入昵称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-block">
                        <select name="status" style="width:100%">
                            <option value="">--请选择状态--</option>
                            <option value="1" {if condition="$Request.get.status eq 1"}selected{/if}>待审核</option>
                            <option value="2" {if condition="$Request.get.status eq 2"}selected{/if}>已通过</option>
                            <option value="3" {if condition="$Request.get.status eq 3"}selected{/if}>已拒绝</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </form>

        <div class="layui-card-body">
            <xblock>
                <div style="padding-bottom: 10px;">
                    <span style="line-height:40px;float:right;">共有数据： {$count}条</span>
                </div>
            </xblock>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>UID</th>
                    <th>昵称</th>
                    <th>提现金额</th>
                    <th>提现方式</th>
                    <th>账户信息</th>
<!--                    <th>提现二维码</th>-->
                    <th>状态</th>
                    <th>拒绝原因</th>
                    <th>时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                <tr>
                    <td>{$vo['user_id']}</td>
                    <td>{$vo['user_name']}</td>

                    <td>{$vo['tal_money']}</td>
                    <td>
                        {if condition="$vo['type'] eq 1"}
                        微信
                        {elseif condition="$vo['type'] eq 2"}
                        支付宝
                        {elseif condition="$vo['type'] eq 3"}
                        银行卡
                        {/if}
                    </td>
                    <td>
                        {if condition="$vo['type'] eq 1"}
                        微信
                        {elseif condition="$vo['type'] eq 2"}

                        姓名: <span style="color:red">{$vo['name']}</span><br />
                        支付宝账号: <span style="color:red">{$vo['number']}</span><br />
                        {elseif condition="$vo['type'] eq 3"}

                        开户行: <span style="color:red">{$vo['bank']}</span><br />
                        姓名: <span style="color:red">{$vo['name']}</span><br />
                        银行卡账号: <span style="color:red">{$vo['number']}</span><br />
                        {/if}
                    </td>
<!--                    <td><img src="{$vo['imgurl']}" alt="" style="width: 100px;height: 50px;cursor: pointer" onclick="preview_image_list('{$vo[\'imgurl\']}')"></td>-->

                    <td>
                        {if condition="$vo['status'] eq 1"}
                        <button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-sm">待审核</button>
                        {elseif condition="$vo['status'] eq 2" /}
                        <button class="layui-btn layui-btn-warm layui-btn-radius layui-btn-sm">已通过</button>
                        {elseif condition="$vo['status'] eq 3" /}
                        <button class="layui-btn layui-btn-danger layui-btn-radius layui-btn-sm">已拒绝</button>
                        {/if}
                    </td>
                    <td>{$vo['reason']}</td>
                    <td>{$vo['addtime']|date="Y-m-d H:i"}</td>
                    <td>
                        {if condition="$vo['status'] eq 1" /}
                        <a style="text-decoration:none" title="通过" onClick="pass({$vo.id},1)" class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">通过</a>
                        <a style="text-decoration:none" title="拒绝" onClick="pass({$vo.id},'2')" class="layui-btn layui-btn-danger layui-btn-radius layui-btn-xs">拒绝</a>
                        {/if}

                    </td>
                </tr>
                {/volist}

                {if condition="empty($list)"}
                <tr><td colspan='10' style="text-align:center;">暂时没有数据！</td></tr>
                {/if}

                </tbody>
            </table>
            <div class="layui-box layui-laypage layui-laypage-default" style="margin-left:40%">
                {$page}
            </div>
        </div>
    </div>
</div>
{include file="Public:footer"/}
<script type="text/javascript">
    layui.use(['table'], function(){

    });

    //表格图片预览
    function preview_image_list(img_src){
        var iHtml = "<img src='" + img_src + "' />";
        layer.open({
            type: 1,
            area: ['50%','60%'],
            shade: false,
            title: false, //不显示标题
            content: iHtml //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
        });
    }

    //解封/封号
    function pass(id,type){
        if (type == 1){
            layer.confirm('确认要执行当前操作吗？',function(){
                var url = "{:url('/admin/withdrawpass')}";
                var $ = layui.$;
                $.post(url,{"id":id,'status':type},function(data){
                    if(data.status == 1){
                        layer.msg(data.msg,{icon:1,time:1000},function(){
                            location.reload();
                        });
                    }else{
                        layer.msg(data.msg,{icon:2,anim:6,time:1500},function(){
                            layer.close(load);
                        });
                    }
                })
            });
        }else {
            layer.prompt({title: '请输入拒绝理由'}, function(value, index){
                var url = "{:url('/admin/withdrawpass')}";
                var $ = layui.$;
                $.post(url,{"id":id,'status':type,'reason':value},function(data){
                    if(data.status == 1){
                        layer.msg(data.msg,{icon:1,time:1000},function(){
                            location.reload();
                        });
                    }else{
                        layer.msg(data.msg,{icon:2,anim:6,time:1500},function(){
                            layer.close(load);
                        });
                    }
                })
            });
        }

    }



</script>
</body>
</html>


